﻿var car; 
function transcrire() {
car = document.conversion.saisie.value; 

car  = car.replace(/H/g, "ح");
car  = car.replace(/Z/g, "ظ");
car  = car.replace(/T/g, "ط");
car  = car.replace(/İ/g, "ى");
car  = car.replace(/a  /g, "ه ");
car  = car.replace(/i /g, "ى ");
car  = car.replace(/ı /g, "ى ");
car  = car.replace(/ i/g, " اي");
car  = car.replace(/e /g, "ه ");
car  = car.replace(/S/g, "ص");
car = car.replace(/A/g, "آ");
car = car.replace(/a/g, "ا");
car  = car.replace(/w/g, "ع");
car  = car.replace(/ o/g, " او");
car  = car.replace(/ ö/g, " او");
car  = car.replace(/ u/g, " او");
car  = car.replace(/ ü/g, " او");

car  = car.replace(/b/g, "ب");
car  = car.replace(/B/g, "ب");
car  = car.replace(/p/g, "پ");
car  = car.replace(/P/g, "پ");
car  = car.replace(/t/g, "ت");
car  = car.replace(/T/g, "ت");
car  = car.replace(/c/g, "ج");
car  = car.replace(/C/g, "ج");
car  = car.replace(/ç/g, "چ");
car  = car.replace(/Ç/g, "چ");
car  = car.replace(/x/g, "خ");
car  = car.replace(/X/g, "خ");
car  = car.replace(/d/g, "د");
car  = car.replace(/D/g, "ض");
car  = car.replace(/r/g, "ر");
car  = car.replace(/R/g, "ر");
car  = car.replace(/z/g, "ز");
car  = car.replace(/Z/g, "ز");
car  = car.replace(/j/g, "ژ");
car  = car.replace(/J/g, "ژ");
car  = car.replace(/s/g, "س");
car  = car.replace(/S/g, "س");
car  = car.replace(/ş/g, "ش");
car  = car.replace(/Ş/g, "ش");
car  = car.replace(/f/g, "ف");
car  = car.replace(/F/g, "ف");
car  = car.replace(/q/g, "ق");
car  = car.replace(/Q/g, "ق");
car  = car.replace(/k/g, "ك");
car  = car.replace(/K/g, "ك");
car  = car.replace(/Ğ/g, "ك");
car  = car.replace(/g/g, "ك");
car  = car.replace(/G/g, "ك");
car  = car.replace(/l/g, "ل");
car  = car.replace(/L/g, "ل");
car  = car.replace(/m/g, "م");
car  = car.replace(/M/g, "م");
car  = car.replace(/n/g, "ن");
car  = car.replace(/N/g, "ن");
car  = car.replace(/v/g, "و");
car  = car.replace(/V/g, "و");
car  = car.replace(/w/g, "و");
car  = car.replace(/W/g, "و");
car  = car.replace(/o/g, "و");
car  = car.replace(/u/g, "و");
car  = car.replace(/U/g, "و");
car  = car.replace(/ü/g, "و");
car  = car.replace(/ö/g, "و");
car  = car.replace(/O/g, "و");
car  = car.replace(/Ö/g, "و");
car  = car.replace(/Ü/g, "و");
car  = car.replace(/h/g, "ه");
car  = car.replace(/H/g, "ه");
car  = car.replace(/e/g, "");
car  = car.replace(/E/g, "ا");
car  = car.replace(/,/g, "،");
car  = car.replace(/;/g, "؛");
car  = car.replace(/ğ/g, "غ");

// Trankskripsiyon
car  = car.replace(/â/g, "آ");
car  = car.replace(/æ/g, "ث");
car  = car.replace(/Â/g, "آ");
car  = car.replace(/å/g, "ث");
car  = car.replace(/Ó/g, "ح");
car  = car.replace(/ó/g, "ح");
car  = car.replace(/Ô/g, "ظ");
car  = car.replace(/ô/g, "ظ");
car  = car.replace(/Õ/g, "ذ");
car  = car.replace(/õ/g, "ذ");
car  = car.replace(/Ù/g, "ط");
car  = car.replace(/ù/g, "ط");
car  = car.replace(/Ú/g, "ق");
car  = car.replace(/ú/g, "ق");
car  = car.replace(/Û/g, "و");
car  = car.replace(/û/g, "و");
car  = car.replace(/Ò/g, "خ");
car  = car.replace(/ò/g, "خ");
car  = car.replace(/á/g, "غ");
car  = car.replace(/à/g, "غ");
car  = car.replace(/ä/g, "ص");
car  = car.replace(/ã/g, "ص");
car  = car.replace(/ë/g, "ض");
car  = car.replace(/ê/g, "ض");
car  = car.replace(/è/g, "ع");
car  = car.replace(/é/g, "غ");
car  = car.replace(/ñ/g, "ك");
car  = car.replace(/'/g, "");
car  = car.replace(/I/g, "ى");
car  = car.replace(/À/g, "ا");
car  = car.replace(/Á/g, "ا");
car  = car.replace(/Ì/g, "ي");
car  = car.replace(/Í/g, "ي");
car  = car.replace(/Ñ/g, "ك");
car  = car.replace(/ß/g, "و");
// SORU İŞARETİ



// Y harfi
car  = car.replace(/ı/g, "ي");
car  = car.replace(/i/g, "ي");
car  = car.replace(/y/g, "ي");
car  = car.replace(/Y/g, "ي");
car  = car.replace(/î/g, "ي");

// Digerleri



car  = car.replace(/ت'/g, "ث");
car  = car.replace(/وء/g, "ؤ");
car  = car.replace(/يء/g, "ئ");
car  = car.replace(/ءا/g, "أ");
car  = car.replace(/"/g, "ع");
car  = car.replace(/س'/g, "ش");
car  = car.replace(/غ'/g, "غ");
car  = car.replace(/ص'/g, "ض");
car  = car.replace(/ط'/g, "ظ");
car  = car.replace(/د'/g, "ذ");
car  = car.replace(/ح'/g, "خ");
car  = car.replace(/ر'/g, "ز");
car  = car.replace(/ه'/g, "ة");
car  = car.replace(/وو/g, "و");

car  = car.replace(/0/g, "۰");
car  = car.replace(/1/g, "۱");
car  = car.replace(/2/g, "۲");
car  = car.replace(/3/g, "۳");
car  = car.replace(/4/g, "۴");
car  = car.replace(/5/g, "۵");
car  = car.replace(/6/g, "۶");
car  = car.replace(/7/g, "۷");
car  = car.replace(/8/g, "۸");
car  = car.replace(/9/g, "۹");

// ع å Ó ó Ô ô Õ õ Ù ù Ú  ú Û û Ò ò á  à  ä ã ë  ê è é
document.conversion.saisie.value=car;
var obj=document.conversion.saisie;
obj.focus();
obj.scrollTop=obj.scrollHeight;
}
function OSMANLICA(unicode) {
var myForm = document.conversion.saisie;
  if (document.selection) {
myForm.focus();
sel = document.selection.createRange();
sel.text = String.fromCharCode(unicode);
document.conversion.focus();
}
else if (document.conversion.saisie.selectionStart || document.conversion.saisie.selectionStart == "0") {
 var startPos = document.conversion.saisie.selectionStart;
var endPos = document.conversion.saisie.selectionEnd;
 var chaine = document.conversion.saisie.value;
myForm.value = chaine.substring(0, startPos) + String.fromCharCode(unicode) + chaine.substring(endPos, chaine.length);
} else {
 myForm.value += String.fromCharCode(unicode);
}
var obj=document.conversion.saisie;
obj.focus();
obj.scrollTop=obj.scrollHeight;
 }
function copy()
{ textRange=document.conversion.saisie.createTextRange();   textRange.execCommand("Copy");   textRange="";
}
